//
//  LKAddRoleViewController.m
//  Mideleague_Agent
//
//  Created by Zhiwang on 2020/6/10.
//  Copyright © 2020 Zhiwang. All rights reserved.
//

#import "LKAddRoleViewController.h"

@interface LKAddRoleViewController ()


@property(nonatomic,strong)UFFormView *formView;

@end

@implementation LKAddRoleViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"新增角色";
    [self createFormView];
    // Do any additional setup after loading the view.
}

-(void)createFormView{
    WS(weakSelf)
    self.formView = [UFFormView makeFormView:^(UFFormViewMaker * _Nonnull make) {
     make
    .addSection([UFSection makeSection:^(UFSectionMaker * _Nonnull make) {
        make
        .titleStyle([UFRowTitleStyle makeTitleStyle:^(UFRowTitleStyleMaker * _Nonnull make) {
           make
            .font([UIFont fontWithName:@"PingFangSC-Regular" size:16])
            .color(labelBlackColor)
            .textAlignment(NSTextAlignmentLeft);
        }])
        .valueStyle([UFTextStyle makeTextStyle:^(UFRowTextStyleMaker * _Nonnull make) {
            make
            .textAlignment(NSTextAlignmentRight)
            .font([UIFont fontWithName:@"PingFangSC-Regular" size:16])
            .color(labelBlackColor);
            
        }])
        .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
            make
            .height(RowHeightDefault)
            .title(@"角色名称")
            .name(@"merchant_name")
            .value(@"");
        }])
        .addRow([UFTextFieldRow makeTextFieldRow:^(UFTextFieldRowMaker * _Nonnull make) {
            make
            .height(RowHeightDefault)
            .title(@"备注信息")
            .name(@"")
            .value(@"");
        }]);
    }])
    .addSection([UFSection makeSection:^(UFSectionMaker * _Nonnull make) {
        make
        .titleStyle([UFRowTitleStyle makeTitleStyle:^(UFRowTitleStyleMaker * _Nonnull make) {
           make
            .font([UIFont fontWithName:@"PingFangSC-Regular" size:16])
            .color(labelBlackColor)
            .textAlignment(NSTextAlignmentLeft);
        }])
        .valueStyle([UFTextStyle makeTextStyle:^(UFRowTextStyleMaker * _Nonnull make) {
            make
            .textAlignment(NSTextAlignmentRight)
            .font([UIFont fontWithName:@"PingFangSC-Regular" size:16])
            .color(labelBlackColor);
            
        }])
        .headerStyle([UFSectionStyle makeSectionStyle:^(UFSectionStyleMaker * _Nonnull make) {
            make
            .height(50)                         // 设置头高度
            .text(@"聚合支付")                      // 设置头描述信息
            .color(COLOR_HEX(0x333333))    // 设置头描述信息颜色
            .font([UIFont fontWithName:@"PingFangSC-Regular" size:16]); // 设置头描述信息字体
        }])
        .addRow([UFSwitchRow makeSwitchRow:^(UFSwitchRowMaker * _Nonnull make) {
            make
            .tintColor(yellowDefaultColor)
            .title(@"收款")
            .value(SWITCH_ON)
            .name(@"roleId")
            .valueDidChanged(^(__kindof UFRow * _Nonnull row, __kindof NSString * _Nonnull value) {
            });
        }])
        .addRow([UFSwitchRow makeSwitchRow:^(UFSwitchRowMaker * _Nonnull make) {
            make
            .tintColor(yellowDefaultColor)
            .title(@"支付流水")
            .value(SWITCH_ON)
            .name(@"roleId")
            .valueDidChanged(^(__kindof UFRow * _Nonnull row, __kindof NSString * _Nonnull value) {
            });
        }])
        .addRow([UFSwitchRow makeSwitchRow:^(UFSwitchRowMaker * _Nonnull make) {
            make
            .tintColor(yellowDefaultColor)
            .title(@"报表")
            .value(SWITCH_ON)
            .name(@"roleId")
            .valueDidChanged(^(__kindof UFRow * _Nonnull row, __kindof NSString * _Nonnull value) {
            });
        }])
        .addRow([UFSwitchRow makeSwitchRow:^(UFSwitchRowMaker * _Nonnull make) {
            make
            .tintColor(yellowDefaultColor)
            .title(@"台签")
            .value(SWITCH_ON)
            .name(@"roleId")
            .valueDidChanged(^(__kindof UFRow * _Nonnull row, __kindof NSString * _Nonnull value) {
            });
        }])
        .addRow([UFSwitchRow makeSwitchRow:^(UFSwitchRowMaker * _Nonnull make) {
            make
            .tintColor(yellowDefaultColor)
            .title(@"硬件管理")
            .value(SWITCH_ON)
            .name(@"roleId")
            .valueDidChanged(^(__kindof UFRow * _Nonnull row, __kindof NSString * _Nonnull value) {
            });
        }]);
        
    }])
    .addSection([UFSection makeSection:^(UFSectionMaker * _Nonnull make) {
        make
        .titleStyle([UFRowTitleStyle makeTitleStyle:^(UFRowTitleStyleMaker * _Nonnull make) {
           make
            .font([UIFont fontWithName:@"PingFangSC-Regular" size:16])
            .color(labelBlackColor)
            .textAlignment(NSTextAlignmentLeft);
        }])
        .valueStyle([UFTextStyle makeTextStyle:^(UFRowTextStyleMaker * _Nonnull make) {
            make
            .textAlignment(NSTextAlignmentRight)
            .font([UIFont fontWithName:@"PingFangSC-Regular" size:16])
            .color(labelBlackColor);
            
        }])
        .headerStyle([UFSectionStyle makeSectionStyle:^(UFSectionStyleMaker * _Nonnull make) {
            make
            .height(50)                         // 设置头高度
            .text(@"我的")                      // 设置头描述信息
            .color(COLOR_HEX(0x333333))    // 设置头描述信息颜色
            .font([UIFont fontWithName:@"PingFangSC-Regular" size:16]); // 设置头描述信息字体
        }])
        .addRow([UFSwitchRow makeSwitchRow:^(UFSwitchRowMaker * _Nonnull make) {
            make
            .tintColor(yellowDefaultColor)
            .title(@"联盟管理")
            .value(SWITCH_ON)
            .name(@"roleId")
            .valueDidChanged(^(__kindof UFRow * _Nonnull row, __kindof NSString * _Nonnull value) {
            });
        }])
        .addRow([UFSwitchRow makeSwitchRow:^(UFSwitchRowMaker * _Nonnull make) {
            make
            .tintColor(yellowDefaultColor)
            .title(@"小程序管理")
            .value(SWITCH_ON)
            .name(@"roleId")
            .valueDidChanged(^(__kindof UFRow * _Nonnull row, __kindof NSString * _Nonnull value) {
            });
        }])
        .addRow([UFSwitchRow makeSwitchRow:^(UFSwitchRowMaker * _Nonnull make) {
            make
            .tintColor(yellowDefaultColor)
            .title(@"我的费率")
            .value(SWITCH_ON)
            .name(@"roleId")
            .valueDidChanged(^(__kindof UFRow * _Nonnull row, __kindof NSString * _Nonnull value) {
            });
        }])
        .addRow([UFSwitchRow makeSwitchRow:^(UFSwitchRowMaker * _Nonnull make) {
            make
            .tintColor(yellowDefaultColor)
            .title(@"台签")
            .value(SWITCH_ON)
            .name(@"roleId")
            .valueDidChanged(^(__kindof UFRow * _Nonnull row, __kindof NSString * _Nonnull value) {
            });
        }])
        .addRow([UFSwitchRow makeSwitchRow:^(UFSwitchRowMaker * _Nonnull make) {
            make
            .tintColor(yellowDefaultColor)
            .title(@"员工管理")
            .value(SWITCH_ON)
            .name(@"roleId")
            .valueDidChanged(^(__kindof UFRow * _Nonnull row, __kindof NSString * _Nonnull value) {
            });
        }]);
        
    }])
    
        // 添加提交按钮
    .addSubmitButton([UFActionButton makeActionButton:^(UFActionButtonMaker * _Nonnull make) {
        make
        .titleForState(@"确认添加", UIControlStateNormal)
        .titleColorForState([UIColor whiteColor], UIControlStateNormal)
        .cornerRadius(25)
        .backgroundColor(yellowDefaultColor)
        .actionButtonClick(^(UFActionButton * _Nonnull button) {

        });
    }])
    .addToSuperView(self.view);
  }];
    [self.formView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(self.view);
        make.top.equalTo(self.view).mas_equalTo(NAVIGATION_BAR_HEIGHT + 10);
        make.bottom.equalTo(self.view);
    }];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
